home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Id: NetAbort.c 1.4 1995/08/29 23:48:55 daltern Exp $
- */
-
- #include "Neural.h"
-
- /*
- * Global variables for deallocation.
- */
-
- extern NET *netI_g;
- extern VECTOR *vecS_g;
- extern float **Node_g;
- extern float ***Weight_g;
- extern float ***Delta_weight_g;
-
-
- void NetAbort( int sig )
-
- {
-
-
- register int i, j;
-
- if ( vecS_g->InVec != NULL )
- FREE2D(vecS_g->InVec,MAX_VECS);
-
- if ( vecS_g->OutVec != NULL )
- FREE2D(vecS_g->OutVec,MAX_VECS);
-
- if ( Weight_g != NULL )
- FREE3D(Weight_g,(netI_g->NumLayers-1),(netI_g->LayerSize[i]));
-
- if ( Delta_weight_g != NULL )
- FREE3D(Delta_weight_g,(netI_g->NumLayers-1),(netI_g->LayerSize[i]+1));
-
- if ( Node_g != NULL ) {
- for ( i = 1; i < netI_g->NumLayers; i++ ) {
- free(Node_g[i]);
- } /* end for i */
- free(Node_g);
- } /* end if */
-
- if ( netI_g->LayerSize != NULL )
- free(netI_g->LayerSize);
-
- fprintf( stderr, "\n\n Cleaning up and exiting \n" );
- fprintf( stderr, " config file will not be changed\n" );
- exit(5);
-
-
- } /* end function NetAbort */
-
- /*=============================================================================*
- END FUNCTION
- *==============================================================================*/
-